<template>
  <div class="pages_content table">
    <el-container>
      <el-header>
        <breaDcrumb />
      </el-header>
      <el-main>
        <div class="tabtop">
          <div v-for="(item, index) in contractTypelist" :key="index" @click="choose(item.id)">
            <div :class="currenindex == index ? 'active' : 'text'">{{ item.value }}</div>
            <div v-if="currenindex !== index && currenindex !== index + 1 && index !== 2" class="hr"></div>
          </div>
        </div>
        <Outsourcing v-if="currenindex==2"></Outsourcing>
        <div v-else>
          <div class="header_right" @click="showCardNav = !showCardNav">
            <div class="title">搜索</div>
            <div>
              <span v-show="!showCardNav">
                <i style="margin-right: 5px;" class="el-icon-arrow-down"></i>
              </span>
              <span v-show="showCardNav">
                <i style="margin-right: 5px;" class="el-icon-arrow-up"></i>
              </span>
            </div>
          </div>
          <div v-show="showCardNav" class="hr"></div>
          <el-collapse-transition>
            <div v-show="showCardNav">
              <div class="search">
                <span style="display: inline-block;margin-bottom: 10px;">
                  <span style="margin-right: 12px;">订单编号</span>
                  <el-input v-model="tableParam.orderNo" style="width: 220px;" clearable placeholder="请输入" @keyup.enter.native="gettableData()" />
                </span>
                <span style="margin-left: 24px;">
                  <span style="margin-right: 12px;">工程名称</span>
                  <el-input v-model="tableParam.engineeringName" style="width: 220px;" clearable placeholder="请输入" @keyup.enter.native="gettableData()" />
                </span>
                <span v-if="currenindex==0" style="margin-left: 24px;">
                  <span style="margin-right: 12px;">审核状态</span>
                  <el-select ref="approvalStatus0" v-model="approvalStatus0" style="width: 160px;" placeholder="请选择" @change="$nextTick(()=>{tableParam.approvalStatus =approvalStatus0})">
                    <el-option label="待审核" value="1"></el-option>
                    <el-option label="已通过" value="2"></el-option>
                    <el-option label="未通过" value="3"></el-option>
                    <el-option label="已取消" value="4"></el-option>
                  </el-select>
                </span>
                <span v-if="currenindex==1" style="margin-left: 24px;">
                  <span style="margin-right: 12px;">状态</span>
                  <el-select v-model="customerCheckStatus0" style="width: 160px;" placeholder="请选择" @change="$nextTick(()=>{tableParam.customerCheckStatus =customerCheckStatus0})">
                    <el-option label="待调整" value="0"></el-option>
                    <el-option label="待客户确认" value="1"></el-option>
                    <el-option label="客户已确认" value="2"></el-option>
                    <el-option label="客户已拒绝" value="3"></el-option>
                    <el-option label="订单已完成" value="4"></el-option>
                    <el-option label="订单已取消" value="6"></el-option>
                  </el-select>
                </span>
                <el-button v-if='currenindex == 1' icon="el-icon-search" size="medium" class="bottom_all but1" @click="(tableParam.page = 1),query_product_pageFun()">查 询</el-button>
                <el-button v-else icon="el-icon-search" size="medium" class="bottom_all but1" @click="(tableParam.page = 1), gettableData()">查 询</el-button>
                <el-button size="medium" class="bottom_all_two" style="margin-left:12px;" @click="init()">重 置</el-button>
                <el-button size="medium" class="bottom_all_two" style="margin-left: 12px" @click="tableParamType = true">高级搜索</el-button>
              </div>
            </div>
          </el-collapse-transition>
          <div class="hr"></div>
          <div class="card">
            <div class="card_nav" :class="currenindex == 0?'': 'pull-right'">
              <div v-if='currenindex == 0'>
                <el-button v-if="ButtonList.findIndex(res=>(res.buttonValue=='TIANJIA'))!==-1" size="small" class="bottom_all" style="margin-left: 0;" @click="addDialog = true,chongZhi(),addDialogText='添加订单'">
                  <i class="icon iconfont iconicon_button_add" style="font-size: 12px;"></i>
                  添加订单
                </el-button>
                <el-button v-if="ButtonList.findIndex(res=>(res.buttonValue=='QUXIAODINDAN'))!==-1" size="small" class="bottom_four" @click="cancelPlanByIdsFun()">
                  取消订单
                </el-button>
              </div>
              <div>
                <el-dropdown :hide-on-click="false" trigger="click" style="margin: 0 20px;">
                  <el-link :underline="false">
                    <span class="el-icon--left">
                      <i class="iconfont iconicon_button_filtrate"></i>
                    </span>
                    筛选
                  </el-link>
                  <el-dropdown-menu v-if="currenindex == 0" slot="dropdown">
                    <el-dropdown-item v-for="(item, index) in tableA" :key="index">
                      <el-checkbox v-model="item.status">{{ item.label }}</el-checkbox>
                    </el-dropdown-item>
                  </el-dropdown-menu>
                  <el-dropdown-menu v-if="currenindex == 1" slot="dropdown">
                    <el-dropdown-item v-for="(item, index) in tableB" :key="index">
                      <el-checkbox v-model="item.status">{{ item.label }}</el-checkbox>
                    </el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </div>
            </div>
            <div v-loading="tableLoading" class="card_info" :style="style">
              <el-table v-if='currenindex == 0' :header-cell-style="{ background: '#f3f6f9' }" :cell-style="{ borderRight: 'none' }" border stripe style="width:100%" :data="tableData" tooltip-effect="dark" @selection-change="handleSelectionChange">
                <el-table-column v-if="currenindex==0" align="center" type="selection" :selectable="selectableFun"></el-table-column>
                <template v-for="(item, index2) in tableA">
                  <el-table-column v-if="item.status" :key="index2" :label="item.label" align="center" :min-width="item.width" :fixed="item.label =='操作'?'right':false">
                    <template slot-scope="scope">
                      <div v-if="item.label == '订单编号'">
                        <el-link v-if="currenindex == 1" class="table_link" :underline="false" @click="lookFun(scope.row)">{{scope.row.orderNo}}</el-link>
                        <el-link v-else class="table_link" :underline="false" @click="look0Fun(scope.row)">{{scope.row.orderNo}}</el-link>
                      </div>
                      <div v-else-if="item.label == '审核状态'">
                        <span v-if="scope.row.approvalStatus == 1">待审核</span>
                        <span v-if="scope.row.approvalStatus == 2">已通过</span>
                        <span v-if="scope.row.approvalStatus == 3">未通过</span>
                        <span v-if="scope.row.approvalStatus == 4">已取消</span>
                      </div>
                      <div v-else-if="item.label == '浇筑方式'">
                        <div>{{scope.row.pouringMethod | pouringMethodFilter}}</div>
                      </div>
                      <div v-else-if="item.label == '订单类型'">
                        <span v-if="scope.row.orderType == 1">市场扩展订单</span>
                        <span v-if="scope.row.orderType == 2">市场扩展调整订单</span>
                        <span v-if="scope.row.orderType == 3">外协业务订单</span>
                        <span v-if="scope.row.orderType == 4">自用订单</span>
                        <span v-if="scope.row.orderType == 5">非市场扩展订单</span>
                      </div>
                      <span v-else>{{ scope.row[item.prop] }}</span>
                    </template>
                  </el-table-column>
                </template>
              </el-table>
              <el-table v-if='currenindex == 1' ref="table1" :header-cell-style="{ background: '#f3f6f9' }" :cell-style="{ borderRight: 'none' }" border stripe style="width:100%" :data="tableData1" tooltip-effect="dark" :span-method="objectSpanMethod">
                <el-table-column v-if="currenindex==0" align="center" type="selection" :selectable="selectableFun"></el-table-column>
                <template v-for="(item, index2) in tableB">
                  <el-table-column v-if="item.status" :key="index2" :label="item.label" align="center" :min-width="item.width" :fixed="item.label =='操作'?'right':false">
                    <template slot-scope="scope">
                      <div v-if="item.label == '订单编号'">
                        <el-link v-if="currenindex == 1" class="table_link" :underline="false" @click="lookFun(scope.row)">{{scope.row.orderNo}}</el-link>
                        <el-link v-else class="table_link" :underline="false" @click="look0Fun(scope.row)">{{scope.row.orderNo}}</el-link>
                      </div>
                      <div v-else-if="item.label == '浇筑方式'">
                        <div>{{scope.row.pouringMethod | pouringMethodFilter}}</div>
                      </div>
                      <div v-else-if="item.label == '订单类型'">
                        <span v-if="scope.row.orderType == 1">市场扩展订单</span>
                        <span v-if="scope.row.orderType == 2">市场扩展调整订单</span>
                        <span v-if="scope.row.orderType == 3">外协业务订单</span>
                        <span v-if="scope.row.orderType == 4">自用订单</span>
                        <span v-if="scope.row.orderType == 5">非市场扩展订单</span>
                      </div>
                      <div v-else-if="item.label == '状态'">
                        <span v-if="scope.row.customerCheckStatus == 0">待调整</span>
                        <span v-if="scope.row.customerCheckStatus == 1">待客户确认</span>
                        <span v-if="scope.row.customerCheckStatus == 2">客户已确认</span>
                        <span v-if="scope.row.customerCheckStatus == 3">客户已拒绝</span>
                        <span v-if="scope.row.customerCheckStatus == 4">订单已完成</span>
                        <span v-if="scope.row.customerCheckStatus == 6">订单已取消</span>
                      </div>
                      <div v-else-if="item.label == '操作'">
                        <el-button v-if="(scope.row.customerCheckStatus == 0||scope.row.approvalStatus == 1)&&ButtonList.findIndex(res=>(res.buttonValue=='TIAOZHENG'))!==-1" size="mini" class="bottom_one" @click="chongZhi2(),ToViewFun2(scope.row,scope.row.customerCheckStatus,scope.row.orderType)"><span>调整</span></el-button>
                        <el-button v-else size="mini" class="bottom_one" @click="chongZhi2(),ToViewFun2(scope.row,scope.row.customerCheckStatus,scope.row.orderType)"><span>查看</span></el-button>
                      </div>
                      <span v-else>{{ scope.row[item.prop] }}</span>
                    </template>
                  </el-table-column>
                </template>
              </el-table>
            </div>
            <div class="card_bottom">
              <div class="card_bottom_left">
                <div class="top_page_totle">总共{{ total }}条</div>
                <el-pagination v-if='currenindex == 1' :current-page.sync="tableParam.page" :page-size="tableParam.pageSize" layout="prev, pager, next, jumper" :total="total" @current-change="query_product_pageFun()"></el-pagination>
                <el-pagination v-else :current-page.sync="tableParam.page" :page-size="tableParam.pageSize" layout="prev, pager, next, jumper" :total="total" @current-change="gettableData()"></el-pagination>
              </div>
              <div>
                <el-button v-if='currenindex == 1' size="mini" icon="el-icon-refresh-right" class="bottom_all_two" @click="query_product_pageFun()">刷新</el-button>
                <el-button v-else size="mini" icon="el-icon-refresh-right" class="bottom_all_two" @click="gettableData">刷新</el-button>
              </div>
            </div>
          </div>
        </div>
      </el-main>
    </el-container>
    <!-- 添加 -->
    <el-dialog v-dialogDrag :visible.sync="addDialog" width="1000px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">{{addDialogText}}</span>
      <div class="dialoginfo">
        <el-form ref="reffromData" :rules="rules" :inline="true" :model="formData" label-width="110px" :hide-required-asterisk="true">
          <el-form-item prop="stationId" :rules="[{required: true,message: '请选择站点名称',trigger: 'blur',}]">
            <span slot="label" style="color: #ff0000">站点名称</span>
            <el-select ref="selection2" v-model="formData.stationId" placeholder="请选择" @change="get_simple_organizationFun(formData.stationId),$nextTick(()=>{formData.stationName = $refs.selection2.selectedLabel},contractIdListFun(true))">
              <el-option v-for="item in stationIdlist" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="orderType" :rules="[{required: true,message: '请选择订单类型',trigger: 'blur',}]">
            <span slot="label" style="color: #ff0000">订单类型</span>
            <el-select v-model="formData.orderType" placeholder="请选择" @change="engineeringManagementQueryListFinishFun(true)">
              <el-option label="市场扩展" :value="1"></el-option>
              <el-option label="非市场扩展" :value="5"></el-option>
              <el-option label="自用业务" :value="4"></el-option>
              <el-option label="往来业务" :value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item v-if="formData.orderType==3" prop="contractId" :rules="[{required: true,message: '请选择外协单位',trigger: 'blur',}]">
            <span slot="label" style="color: #ff0000">协外单位</span>
            <el-select ref="selection5" v-model="formData.contractId" placeholder="请选择" @change="contractIdFun()">
              <el-option v-for="item in contractIdList" :key="item.contractId" :label="item.contractNumber+'：'+item.supplierName" :value="item.contractId"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="engineeringId" :rules="[{required: true,message: '请旋转工程',trigger: 'change',}]">
            <span slot="label" style="color: #ff0000">工程名称</span>
            <el-select ref="selection3" v-model="formData.engineeringId" filterable allow-create default-first-option placeholder="请选择" @change="$nextTick(()=>{formData.engineeringName = $refs.selection3.selectedLabel},addDialogFun(),getListsFun())">
              <el-option v-for="item in engineeringNameList" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">备注工程名字</span>
            <el-input v-model="formData.engineeringNameRemark" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">浇筑部位</span>
            <!-- <el-select v-model="formData.structuralParts" filterable allow-create default-first-option placeholder="请选择" @change="structuralPartsCheckFun()">
              <el-option v-for="item in structuralPartsList" :key="item.id" :label="item.structuralParts+(item.used==1?'已选择':'未选择')" :value="item.id"></el-option>
            </el-select> -->
            <el-input v-model="formData.structuralParts" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item prop="strengthGradeId">
            <span slot="label" style="color: #ff0000">强度等级</span>
            <el-select ref="strengthGrade" v-model="formData.strengthGradeId" placeholder="请选择" @change="$nextTick(()=>{formData.strengthGrade = $refs.strengthGrade.selectedLabel})">
              <el-option v-for="item in strengthGradeList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">性能等级</span>
            <el-select v-model="formData.performanceGradeId" multiple placeholder="请选择">
              <el-option v-for="item in performanceGradeList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">材料要求</span>
            <el-select v-model="formData.meterialRequirementsId" multiple placeholder="请选择">
              <el-option v-for="item in meterialRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">特殊要求</span>
            <el-select v-model="formData.specialRequirementsId" multiple placeholder="请选择">
              <el-option v-for="item in specialRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">其他要求</span>
            <el-select v-model="formData.otherRequirementsId" multiple placeholder="请选择">
              <el-option v-for="item in otherRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">外加剂要求</span>
            <el-select v-model="formData.admixtureRequirements" multiple placeholder="请选择">
              <el-option v-for="item in admixtureRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">浇筑方式</span>
            <el-select v-model="formData.pouringMethod" multiple placeholder="请选择">
              <el-option v-for="item in pouringMethodList" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="pouringTime">
            <span slot="label" style="color: #ff0000">浇筑时间</span>
            <el-date-picker v-model="formData.pouringTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择"></el-date-picker>
          </el-form-item>
          <el-form-item prop="pouringNum">
            <span slot="label" style="color: #ff0000">浇筑用量(方)</span>
            <el-input v-model="formData.pouringNum" placeholder="请输入" type="Number"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">泵送高度(米)</span>
            <el-input v-model="formData.pouringHigh" placeholder="请输入" type="Number"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">联系人</span>
            <el-input v-model="formData.person" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">联系电话</span>
            <el-input v-model="formData.phoneNum" placeholder="请输入" oninput="if(value.length > 11 ){ value = value.slice(0,11)}" onkeypress='return( /\d/.test(String.fromCharCode(event.keyCode)))'></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">订单备注</span>
            <el-input v-model="formData.orderRemark" :rows="2" resize="none" style="width: 760px;" type="textarea" placeholder="请输入" clearable></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="addDialog =false">取 消</el-button>
        <el-button class="bottom_all" style="margin-left: 24px;" @click="submit()">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 详情0 -->
    <el-dialog v-dialogDrag :visible.sync="look0Type" width="1000px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">{{addDialogText}}</span>
      <div class="dialoginfo">
        <el-form ref="reffromData" :rules="rules" :inline="true" :model="formData" label-width="110px" :hide-required-asterisk="true" disabled>
          <el-form-item prop="stationId" :rules="[{required: true,message: '请选择站点名称',trigger: 'blur',}]">
            <span slot="label" style="color: #ff0000">站点名称</span>
            <el-select ref="selection2" v-model="formData.stationId" placeholder="请选择" @change="get_simple_organizationFun(formData.stationId),$nextTick(()=>{formData.stationName = $refs.selection2.selectedLabel},contractIdListFun(true))">
              <el-option v-for="item in stationIdlist" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="orderType" :rules="[{required: true,message: '请选择订单类型',trigger: 'blur',}]">
            <span slot="label" style="color: #ff0000">订单类型</span>
            <el-select v-model="formData.orderType" placeholder="请选择" @change="engineeringManagementQueryListFinishFun(true)">
              <el-option label="市场扩展" :value="1"></el-option>
              <el-option label="非市场扩展" :value="5"></el-option>
              <el-option label="自用业务" :value="4"></el-option>
              <el-option label="往来业务" :value="3"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item v-if="formData.orderType==3" prop="contractId" :rules="[{required: true,message: '请选择外协单位',trigger: 'blur',}]">
            <span slot="label" style="color: #ff0000">协外单位</span>
            <el-select ref="selection5" v-model="formData.contractId" placeholder="请选择" @change="contractIdFun()">
              <el-option v-for="item in contractIdList" :key="item.contractId" :label="item.contractNumber+'：'+item.supplierName" :value="item.contractId"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="engineeringId" :rules="[{required: true,message: '请旋转工程',trigger: 'change',}]">
            <span slot="label" style="color: #ff0000">工程名称</span>
            <el-select ref="selection3" v-model="formData.engineeringId" allow-create default-first-option placeholder="请选择" @change="$nextTick(()=>{formData.engineeringName = $refs.selection3.selectedLabel},addDialogFun(),getListsFun())">
              <el-option v-for="item in engineeringNameList" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">备注工程名字</span>
            <el-input v-model="formData.engineeringNameRemark" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">浇筑部位</span>
            <!-- <el-select v-model="formData.structuralParts" filterable allow-create default-first-option placeholder="请选择" @change="structuralPartsCheckFun()">
              <el-option v-for="item in structuralPartsList" :key="item.id" :label="item.structuralParts+(item.used==1?'已选择':'未选择')" :value="item.id"></el-option>
            </el-select> -->
            <el-input v-model="formData.structuralParts" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item prop="strengthGradeId">
            <span slot="label" style="color: #ff0000">强度等级</span>
            <el-select ref="strengthGrade" v-model="formData.strengthGradeId" placeholder="请选择" @change="$nextTick(()=>{formData.strengthGrade = $refs.strengthGrade.selectedLabel})">
              <el-option v-for="item in strengthGradeList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">性能等级</span>
            <el-select v-model="formData.performanceGradeId" multiple placeholder="请选择">
              <el-option v-for="item in performanceGradeList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">材料要求</span>
            <el-select v-model="formData.meterialRequirementsId" multiple placeholder="请选择">
              <el-option v-for="item in meterialRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">特殊要求</span>
            <el-select v-model="formData.specialRequirementsId" multiple placeholder="请选择">
              <el-option v-for="item in specialRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">其他要求</span>
            <el-select v-model="formData.otherRequirementsId" multiple placeholder="请选择">
              <el-option v-for="item in otherRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">外加剂要求</span>
            <el-select v-model="formData.admixtureRequirements" multiple placeholder="请选择">
              <el-option v-for="item in admixtureRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <span slot="label">浇筑方式</span>
            <el-select v-model="formData.pouringMethod" multiple placeholder="请选择">
              <el-option v-for="item in pouringMethodList" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item prop="pouringTime">
            <span slot="label" style="color: #ff0000">浇筑时间</span>
            <el-date-picker v-model="formData.pouringTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择"></el-date-picker>
          </el-form-item>
          <el-form-item prop="pouringNum">
            <span slot="label" style="color: #ff0000">浇筑用量(方)</span>
            <el-input v-model="formData.pouringNum" placeholder="请输入" type="Number"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">泵送高度(米)</span>
            <el-input v-model="formData.pouringHigh" placeholder="请输入" type="Number"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">联系人</span>
            <el-input v-model="formData.person" placeholder="请输入"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">联系电话</span>
            <el-input v-model="formData.phoneNum" placeholder="请输入" oninput="if(value.length > 11 ){ value = value.slice(0,11)}" onkeypress='return( /\d/.test(String.fromCharCode(event.keyCode)))'></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">订单备注</span>
            <el-input v-model="formData.orderRemark" :rows="2" resize="none" style="width: 760px;" type="textarea" placeholder="请输入" clearable></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="look0Type =false">关 闭</el-button>
      </span>
    </el-dialog>
    <!-- 查看详情 -->
    <el-dialog v-dialogDrag :visible.sync="lookType" width="1000px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">订单基本信息</span>
      <div class="dialoginfo">
        <div class="form-title" style="margin-bottom:10px;">订单号：{{formData4.orderNo}}</div>
        <el-form :inline="true" :model="formData4" label-width="100px">
          <el-form-item>
            <span slot="label">工程名称：</span>
            <div style="width: 190px;">{{formData4.engineeringName}}</div>
          </el-form-item>
          <el-form-item>
            <span slot="label">浇筑部位：</span>
            <div style="width: 190px;">{{formData4.structuralParts}}</div>
          </el-form-item>
          <el-form-item>
            <span slot="label">下单时间：</span>
            <div style="width: 190px;">{{formData4.createTime}}</div>
          </el-form-item>
          <el-form-item>
            <span slot="label">订单提交人：</span>
            <div style="width: 190px;">{{formData4.createUserName}}</div>
          </el-form-item>
          <el-form-item prop="person">
            <span slot="label">联系人：</span>
            <div style="width: 190px;">{{formData4.person}}</div>
          </el-form-item>
          <el-form-item prop="phoneNum">
            <span slot="label">联系电话：</span>
            <div style="width: 190px;">{{formData4.phoneNum}}</div>
          </el-form-item>
          <el-form-item>
            <span slot="label">强度等级：</span>
            <div style="width: 190px;">{{formData4.strengthGrade}}</div>
          </el-form-item>
          <el-form-item>
            <span slot="label">性能等级：</span>
            <div style="width: 190px;">{{formData4.performanceGrade}}</div>
          </el-form-item>
          <el-form-item>
            <span slot="label">材料等级：</span>
            <div style="width: 190px;">{{formData4.meterialRequirements}}</div>
          </el-form-item>
          <el-form-item>
            <span slot="label">特殊要求：</span>
            <div style="width: 190px;">{{formData4.specialRequirements}}</div>
          </el-form-item>
          <el-form-item>
            <span slot="label">其他要求：</span>
            <div style="width: 190px;">{{formData4.otherRequirements}}</div>
          </el-form-item>
          <el-form-item prop="pouringMethod">
            <span slot="label">浇筑方式：</span>
            <div style="width: 190px;">{{formData4.pouringMethod | pouringMethodFilter}}</div>
          </el-form-item>
          <el-form-item prop="pouringTime">
            <span slot="label">浇筑时间：</span>
            <div style="width: 190px;">{{formData4.pouringTime}}</div>
          </el-form-item>
          <el-form-item prop="pouringHigh">
            <span slot="label">泵送高度：</span>
            <div style="width: 190px;">{{formData4.pouringHigh}}</div>
          </el-form-item>
          <div>
            <el-form-item label-width="150px">
              <span slot="label">客户备注：</span>
              <div style="width: 100%;">{{formData4.remark}}</div>
            </el-form-item>
          </div>
          <div>
            <el-form-item>
              <span slot="label">外部备注：</span>
              <div style="width: 100%;">{{formData4.orderRemark}}</div>
            </el-form-item>
          </div>
          <div class="hr" style="margin:20px;"></div>
          <el-form-item prop="graphicNum">
            <span slot="label">产品名称：</span>
            <div style="width: 190px;">{{formData4.productName}}</div>
          </el-form-item>
          <el-form-item prop="noteName">
            <span slot="label">票单名称：</span>
            <div style="width: 190px;">{{formData4.noteName}}</div>
          </el-form-item>
          <el-form-item prop="pointId">
            <span slot="label">供应站点：</span>
            <div style="width: 190px;">{{formData4.point}}</div>
          </el-form-item>
          <el-form-item prop="settleId">
            <span slot="label">结算方式：</span>
            <div style="width: 190px;">{{formData4.settleName}}</div>
          </el-form-item>
          <el-form-item prop="firstSupplyId">
            <span slot="label">富余量：</span>
            <div style="width: 190px;">{{formData4.lossNum}}</div>
          </el-form-item>
          <el-form-item prop="firstSupplyId">
            <span slot="label">前场工长：</span>
            <div style="width: 190px;">{{formData4.foreman}}</div>
          </el-form-item>
          <el-form-item v-show="remarkList.length>0">
            <span slot="label">历史备注</span>
            <div v-for="(v,k) in remarkList" :key="k">{{v.planRemark}}</div>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="lookType = false">关 闭</el-button>
      </span>
    </el-dialog>
    <!-- 调整 -->
    <el-dialog v-dialogDrag :visible.sync="addDialog2" width="1005px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">生产调整</span>
      <div class="dialoginfo scroll" style="height: calc(85vh - 230px);padding-right:5px;overflow: auto;">
        <div ref="FZYinfo">
          <div class="form-title" style="margin-bottom:10px;">订单信息</div>
          <el-form ref="reffromData2" :rules="rules2" :inline="true" :model="formData2" label-width="110px" :disabled="customerCheckStatus">
            <el-form-item>
              <span slot="label">工程名称</span>
              <div style="width: 320px;">{{formData2.engineeringName}}</div>
            </el-form-item>
            <el-form-item>
              <span slot="label">浇筑部位</span>
              <div style="width: 320px;">{{formData2.structuralParts}}</div>
            </el-form-item>
            <el-form-item>
              <span slot="label">下单时间</span>
              <el-input v-model="formData2.createTime" disabled></el-input>
            </el-form-item>
            <el-form-item>
              <span slot="label">订单提交人</span>
              <el-input v-model="formData2.createUserName" disabled></el-input>
            </el-form-item>
            <el-form-item>
              <span slot="label">强度等级</span>
              <el-select v-model="formData2.strengthGradeId" disabled>
                <el-option v-for="item in strengthGradeList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <span slot="label">性能等级</span>
              <el-select v-model="formData2.performanceGradeId" multiple disabled>
                <el-option v-for="item in performanceGradeList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <span slot="label">材料要求</span>
              <el-select v-model="formData2.meterialRequirementsId" multiple disabled>
                <el-option v-for="item in meterialRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <span slot="label">特殊要求</span>
              <el-select v-model="formData2.specialRequirementsId" multiple disabled>
                <el-option v-for="item in specialRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <span slot="label">其他要求</span>
              <el-select v-model="formData2.otherRequirementsId" multiple disabled>
                <el-option v-for="item in otherRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <span slot="label">外加剂要求</span>
              <el-select v-model="formData2.admixtureRequirements" multiple disabled>
                <el-option v-for="item in admixtureRequirementsList" :key="item.ID" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item prop="person">
              <span slot="label">联系人</span>
              <el-input v-model="formData2.person" placeholder="请输入"></el-input>
            </el-form-item>
            <el-form-item prop="phoneNum">
              <span slot="label">联系电话</span>
              <el-input v-model="formData2.phoneNum" placeholder="请输入" oninput="if(value.length > 11 ){ value = value.slice(0,11)}" onkeypress='return( /\d/.test(String.fromCharCode(event.keyCode)))'></el-input>
            </el-form-item>
            <el-form-item prop="pouringNum">
              <span slot="label">浇筑用量</span>
              <el-input v-model="formData2.pouringNum" placeholder="请输入"></el-input>
            </el-form-item>
            <el-form-item>
              <span slot="label">浇筑方式</span>
              <el-select v-model="formData2.pouringMethod" multiple placeholder="请选择">
                <el-option v-for="item in pouringMethodList" :key="item.id" :label="item.name" :value="item.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item prop="pouringTime">
              <span slot="label">浇筑时间</span>
              <el-date-picker v-model="formData2.pouringTime" type="datetime" value-format="yyyy-MM-dd" placeholder="请选择"></el-date-picker>
            </el-form-item>
            <el-form-item prop="pouringHigh">
              <span slot="label">泵送高度</span>
              <el-input v-model="formData2.pouringHigh" placeholder="请输入" onblur="if(value > 5000 ){value = 5000}else if(value < 1 ){ value = 1}" onkeypress='return( /\d|\./.test(String.fromCharCode(event.keyCode)))' @input="formData2.pouringHigh=$regExp.checkNum(formData2.pouringHigh)" @blur="formData2.pouringHigh=$regExp.blurCheckNum(formData2.pouringHigh)"></el-input>
            </el-form-item>
            <el-form-item prop="noteName">
              <span slot="label">票单名称</span>
              <el-input v-model="formData2.noteName" disabled placeholder="请输入"></el-input>
            </el-form-item>
            <el-form-item prop="graphicNum">
              <span slot="label">产品名称</span>
              <span class="productName" style="width: 600px;min-height:32px;padding-top:7px;">{{formData2.productName}}</span>
            </el-form-item>
            <el-form-item>
              <span slot="label">增值服务项</span>
              <div style="width: 660px;height:36px;">{{servicePoint}}</div>
            </el-form-item>
            <el-form-item>
              <el-button class="bottom_two" :disabled="false" @click="choiseBussinessPoint()">更改</el-button>
            </el-form-item>
            <el-form-item>
              <span slot="label">客户备注</span>
              <div class="productName" style="width: 600px;min-height:32px;padding-top:7px;">{{formData2.remark}}</div>
            </el-form-item>
            <el-form-item>
              <span slot="label">外部备注</span>
              <el-input v-model="formData2.orderRemark" :rows="2" resize="none" style="width: 760px;" type="textarea" placeholder="请输入" clearable></el-input>
            </el-form-item>
          </el-form>
          <el-form ref="reffromData2_2" :rules="rules2_2" :inline="true" :model="formData2_2" label-width="110px" :disabled="customerCheckStatus">
            <div class="form-title" style="margin-bottom:10px;">作业安排</div>
            <el-form-item>
              <span slot="label">供应站点</span>
              <el-select ref="pointName" v-model="formData2_2.pointId" placeholder="请选择" disabled @change="$nextTick(()=>{formData2_2.pointName = $refs.pointName.pointId})">
                <el-option v-for="(item,index) in sitelist" :key="index" :label="item.stationName" :value="item.stationId"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <span slot="label">结算方式</span>
              <el-select v-model="formData2_2.settleId" placeholder="请选择" disabled>
                <el-option label="图算加实结" value="0"></el-option>
                <el-option label="仅图算" value="1"></el-option>
                <el-option label="仅实结" value="2"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <span slot="label">富余量</span>
              <el-select v-model="formData2_2.lossNumId" placeholder="请选择" disabled>
                <el-option v-for="(v,k) in marginNumberList" :key="k" :label="v.itemName" :value="v.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <span slot="label">前场工长</span>
              <el-select ref="foremanId" v-model="formData2_2.foremanId" placeholder="请选择" @change="$nextTick(()=>{formData2_2.foreman = $refs.foremanId.selectedLabel})">
                <el-option v-for="(v,k) in foremanIdList" :key="k" :label="v.name" :value="v.id"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <span slot="label">泵送</span>
              <el-input v-model="formData2_2.pumpingTeam" style="width:282px;" disabled></el-input>
              <el-link v-show="!customerCheckStatus" class="table_link" :underline="false" @click="ToViewFun3('泵送')">选择</el-link>
            </el-form-item>
            <el-form-item>
              <span slot="label">运输</span>
              <el-input v-model="formData2_2.tankCar" style="width:282px;" disabled></el-input>
              <el-link v-show="!customerCheckStatus" class="table_link" :underline="false" @click="ToViewFun3('运输')">选择</el-link>
            </el-form-item>
            <el-form-item>
              <span slot="label">泵管</span>
              <el-input v-model="formData2_2.pipeName" style="width:282px;" disabled></el-input>
              <el-link v-show="!customerCheckStatus" class="table_link" :underline="false" @click="ToViewFun3('泵管')">选择</el-link>
            </el-form-item>
            <el-form-item>
              <span slot="label">内部备注</span>
              <el-input v-model="formData2_2.remark" :rows="2" resize="none" style="width: 760px;" type="textarea" placeholder="请输入" clearable></el-input>
            </el-form-item>
            <el-form-item v-show="remarkList.length>1">
              <span slot="label">历史备注</span>
              <div v-for="(v,k) in remarkList" :key="k">
                <div v-if="k>0">
                  {{v.planRemark}}
                </div>
              </div>
            </el-form-item>
            <div class="FZYsctz">
              <div class="form-title" style="margin-bottom:10px;">生产调整</div>
            </div>
            <div style="padding:0px 50px 0px 110px;">
              <el-button v-show="customerCheckStatus==false" size="mini" class="bottom_all" style="margin-left: 0px;margin-bottom: 5px;" @click="addListFun()">
                <i class="icon iconfont iconicon_button_add" style="font-size: 12px;"></i>
                添加
              </el-button>
              <el-table ref="formData2List" :header-cell-style="{ background: '#f3f6f9' }" :cell-style="{ borderRight: 'none' }" border stripe style="width:100%" :data="formData2.list" tooltip-effect="dark" :row-class-name="tableRowClassName">
                <el-table-column label="生产站" align="center" prop="approvalStatus">
                  <template slot-scope="scope">
                    <span v-if="scope.row.foreignName" class="table_link" style="cursor:pointer;" @click="addDialog2_2Fun(scope.$index,scope.row)">{{scope.row.foreignName}}</span>
                    <span v-else class="table_link" style="cursor:pointer;" @click="addDialog2_2Fun(scope.$index,scope.row)">选择</span>
                  </template>
                </el-table-column>
                <el-table-column label="生产时间" align="center" width="230">
                  <template slot-scope="scope">
                    <el-date-picker v-model="scope.row.pouringTime" style="width:100%;" :disabled="customerCheckStatus" type="date" value-format="yyyy-MM-dd hh:mm:ss" placeholder="请选择" :picker-options="pickerOptions"></el-date-picker>
                  </template>
                </el-table-column>
                <el-table-column label="生产量（m³）" align="center" width="150">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.pouringNum" style="width: 100%;" onkeypress='return( /\d|\./.test(String.fromCharCode(event.keyCode)))' @input="scope.row.pouringNum=$regExp.checkNum(scope.row.pouringNum)" @blur="scope.row.pouringNum=$regExp.blurCheckNum(scope.row.pouringNum)"></el-input>
                  </template>
                </el-table-column>
                <el-table-column v-if="customerCheckStatus==false" label="操作" align="center" prop="specification" width="100">
                  <template slot-scope="scope">
                    <el-button size="mini" class="bottom_two" @click="deleteItem(scope.$index,scope.row)">
                      <i class="icon iconfont iconicon_button_delete" style="font-size: 12px;"></i>
                      删除
                    </el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </el-form>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="addDialog2 = false">取 消</el-button>
        <el-button v-if="!customerCheckStatus" class="bottom_all" style="margin-left: 24px;" @click="submit2()">
          <span v-if="servicePoint.length>0 && servicePoint.split(',').findIndex((res)=>res == '客户计划确认') != -1">保存并通知客户</span>
          <span v-else>保存</span>
        </el-button>
        <el-button v-if="formData2.customerCheckStatus==2" size="mini" class="bottom_one" @click="updateOrderStatusFun(formData2)">订单完成</el-button>
      </span>
    </el-dialog>
    <!-- 调整生产站 -->
    <el-dialog v-dialogDrag :visible.sync="addDialog2_2" width="1000px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">调整生产站</span>
      <div class="dialoginfo FZYtable1_2">
        <div>
          <b style="font-size:16px;position: relative;top:-10px;">自主生产:</b>
          <el-table ref="toViewList2_1" :header-cell-style="{ background: '#f3f6f9' }" :cell-style="{ borderRight: 'none' }" border stripe style="width:100%" :data="toViewList2_1" tooltip-effect="dark" @row-click="handleSelectionChange1">
            <el-table-column width="55">
              <template slot-scope="scope">
                <el-radio v-model="multipleSelection" :label="scope.row">{{""}}</el-radio>
              </template>
            </el-table-column>
            <el-table-column label="站点名称" align="center" prop="stationName"></el-table-column>
          </el-table>
        </div>
        <div>
          <b style="font-size:16px;position: relative;top:-10px;">外协生产<small style="color:red;">（选择外协生产，需要进行审批）</small></b>
          <el-table ref="toViewList2_2" :header-cell-style="{ background: '#f3f6f9' }" :cell-style="{ borderRight: 'none' }" border stripe style="width:100%" :data="toViewList2_2" tooltip-effect="dark" @row-click="handleSelectionChange2">
            <el-table-column width="55">
              <template slot-scope="scope">
                <el-radio v-model="multipleSelection" :label="scope.row">{{""}}</el-radio>
              </template>
            </el-table-column>
            <el-table-column label="合同编号" align="center" prop="contractNumber"></el-table-column>
            <el-table-column label="合同单位" align="center" prop="supplierName"></el-table-column>
            <el-table-column label="合作等级" align="center" prop="cooperationClass"></el-table-column>
          </el-table>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="addDialog2_2False">关 闭</el-button>
        <el-button v-if="!customerCheckStatus" class="bottom_all" @click="addDialog2_2UPFun()">保 存</el-button>
      </span>
    </el-dialog>
    <!-- 选择表格 -->
    <el-dialog v-dialogDrag :visible.sync="chooseType" width="1000px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">{{ToViewFun3Name}}</span>
      <div class="dialoginfo">
        <div>
          <el-table ref="multipleTable" :header-cell-style="{ background: '#f3f6f9' }" :cell-style="{ borderRight: 'none' }" border stripe style="width:100%" :data="toViewList2" tooltip-effect="dark">
            <el-table-column width="55">
              <template slot-scope="scope">
                <el-radio v-model="radio" :label="scope.row" @change="radioFun(scope.row)">{{""}}</el-radio>
              </template>
            </el-table-column>
            <el-table-column label="合同编号" align="center" prop="contractNumber"></el-table-column>
            <el-table-column label="合同单位" align="center" prop="supplierName"></el-table-column>
            <el-table-column label="合同等级" align="center" prop="cooperationClass"></el-table-column>
          </el-table>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="chooseType = false">关 闭</el-button>
        <el-button v-if="!customerCheckStatus" class="bottom_all" @click="radioAddFun()">确认</el-button>
      </span>
    </el-dialog>
    <!-- 高级搜索 -->
    <el-dialog v-dialogDrag :visible.sync="tableParamType" width="650px" :close-on-click-modal="false">
      <span slot="title" class="dialog-title">高级搜索</span>
      <div class="dialoginfo">
        <el-form ref="reftableParam" :inline="true" :model="tableParam" label-width="110px">
          <el-form-item>
            <span slot="label">产品名称</span>
            <el-input v-model="tableParam.productName" tplaceholder="请输入" clearable style="width:400px;"></el-input>
          </el-form-item>
          <el-form-item>
            <span slot="label">浇筑时间</span>
            <el-date-picker v-model="startTimDateEndTimDate" type="datetimerange" unlink-panels value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期" @change="tableParam.startDate=startTimDateEndTimDate?startTimDateEndTimDate[0]:'',tableParam.endDate=startTimDateEndTimDate?startTimDateEndTimDate[1]:''"></el-date-picker>
          </el-form-item>
          <el-form-item>
            <span slot="label">客户名称</span>
            <el-input v-model="tableParam.customerName " tplaceholder="请输入" clearable style="width:400px;"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="tableParam.productName='',tableParam.startDate='',tableParam.endDate='',tableParam.customerName ='',tableParamType=false">取 消</el-button>
        <el-button class="bottom_all" style="margin-left: 24px" @click="gettableData(),tableParamType=false">搜 索</el-button>
      </span>
    </el-dialog>
    <!-- 管控业务点 -->
    <el-dialog v-dialogDrag :visible.sync="bussinessVisible" width="60%">
      <span slot="title" class="dialog-title">管控业务点</span>
      <el-checkbox-group v-model="buspointids">
        <template v-for="(item,index) in buspointArr">
          <div :key="index" class="checkbox-bg">
            <el-checkbox :label="item.id" :disabled="customerCheckStatus">{{item.name}}</el-checkbox>
          </div>
        </template>
      </el-checkbox-group>
      <span slot="footer" class="dialog-footer">
        <el-button class="bottom_all_two" @click="bussinessVisible = false">关 闭</el-button>
        <el-button v-show="!customerCheckStatus" class="bottom_all" @click="handlePoint">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script src="./productionschedule.js"></script>
<style lang="scss" scoped>
.pull-right {
  float: right;
}
.dialog-pages {
  @include discen_al;
  padding-top: 10px;
}
.dialog-title {
  font-size: 16px;
  font-weight: bold;
  padding-right: 40px;
}
.el-input,
.el-select {
  width: 320px;
}
.table_link {
  margin: 0 10px;
  color: $bg_color;
}

.table_link:hover {
  opacity: 0.8;
}
.tabtop {
  width: 570px;
}
.FZYkaPian {
  display: flex;
  > div {
    flex: 1;
    border-radius: 15px;
    padding: 15px 20px;
    background: #f2f2f2;
    margin: 30px;
    table {
      width: 100%;
      font-size: 22px;
      text-align: center;
    }
    h5 {
      margin: 15px 0px;
      font-size: 14px;
      font-weight: 600;
    }
  }
}
.form-title {
  font-weight: 600;
  font-size: 16px;
}
.FZYtable1_2 {
  display: flex;
  > div:nth-of-type(1) {
    flex: none;
    width: 260px;
    margin-right: 90px;
  }
  > div:nth-of-type(2) {
    flex: 1;
  }
}
.FZYsctz {
  position: relative;
  .el-link {
    position: absolute;
    top: 0px;
    left: 150px;
  }
  .el-link:nth-of-type(2) {
    left: 300px;
  }
}
.FZYulli {
  position: relative;
  top: -20px;
  > span {
    display: inline-block;
    margin-right: 50px;
  }
}
.productName {
  display: block;
  min-height: 32px;
  line-height: 20px;
  width: 760px;
}
</style>
<style lang="scss">
.checkbox-bg {
  margin: 0 10px 10px 10px;
  display: inline-block;
}
.display-row-FzyHeight {
  display: none;
}
</style>
